//
//  RetrievePasswordViewController.m
//  Hui
//
//  Created by HawkingWang on 16/10/27.
//  Copyright © 2016年 Hui. All rights reserved.
//

#import "RetrievePasswordViewController.h"
#import "LoginWithPhoneViewController.h"//手机号登录

@interface RetrievePasswordViewController () <UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet UIButton *sendCode;
@property (weak, nonatomic) IBOutlet UITextField *phone;
@property (weak, nonatomic) IBOutlet UITextField *code;
@property (weak, nonatomic) IBOutlet UITextField *password;
@property (weak, nonatomic) IBOutlet UITextField *passwordAffirm;

@end

@implementation RetrievePasswordViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    _sendCode.layer.borderWidth = 0.5;
    _sendCode.layer.borderColor = RGBCOLOR(153, 186, 209).CGColor;
}
//重置密码
- (IBAction)resetPwd:(id)sender {
    DLog(@"重置密码");
    if (![_password.text isEqualToString:_passwordAffirm.text]) {
        [EBUtility prompt:@"两次密码不一致,请重新输入" with:self];
    }else{
        [SVProgressHUD show];
        [SVProgressHUD showSuccessWithStatus:@"密码重置成功!"];
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [SVProgressHUD dismiss];
            LoginWithPhoneViewController *login = [[LoginWithPhoneViewController alloc] init];
            [self.navigationController pushViewController:login animated:YES];
        });
    }
    
    
    
}
- (IBAction)back:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}



- (BOOL)textFieldShouldReturn:(UITextField *)textField{
    [textField resignFirstResponder];
    return YES;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
